package com.example.hanchen.yongkanggy.utils;

import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.example.hanchen.yongkanggy.R;
import com.example.hanchen.yongkanggy.http.HttpUrlManager;

public class Page {
    public static final String SIZE = "15";/*当前页最大数*/
    public static final String SIZETO = "9";/*控制推荐最大显示数量*/
    public static final String STATUS = "1";//店铺状态 1上架，-1下架




    public static final int OPEN_GALLERY_CODE = 11;/*相机*/
    public static final int PHOTO_ALBUM = 12;/*相册*/




    public static final int COUPON = 0x0001;/*优惠券*/
    public static final int DEFAULTADDRESS = 0x0002;/*默认地址*/
    public static final int ADDADDRESS = 0x00003;/*新增地址*/
    public static final int ADDSHOPPINGCART = 0x00004;/*加入购物车*/
    public static final int SEXSELECTION = 0x00005;/*性别选择*/
    public static final int ADDRESSSELECTION = 0x00006;/*地址选择*/
    public static final int DETERMINE = 0x00007;/*确定关闭*/


    //    public static final String ADDIMAGE = "https://demo-java.oss-cn-hangzhou.aliyuncs.com";/*图片路劲拼接*/
    public static final String ADDIMAGE = "https://wytapp.obs.cn-east-3.myhuaweicloud.com/";/*图片路劲拼接*/


    /*一恰客服配置*/
    public static final String appId = "SDKAWLAQNPTWCMY9DBD";
    public static final String appsecret = "GBOM9X7XX8YRQ2KPPGJCEWLQDOWXELLME2E99VZV4A2";
    public static final String serverToken = "SFSvyfdp";
    public static final String serverAppId = "B8056874E8DEF02254867D44B854C536";
    public static final String serverEncodingKey = "NWFjODE0MzFlZTY2NGE5ZmJkOTMyMDA1MWFhNThkZmI";
    public static final long platformId = 532999;

    public static final long companyId = 533009;/*公司 id*/




    /*支付宝*/

    /**
     * 用于支付宝支付业务的入参 app_id。
     */
    public static final String APPID = "9021000138691681";
//    public static final String APPID = "2021004157616210";

    /**
     * 用于支付宝账户登录授权业务的入参 pid。
     */
//    public static final String PID = "2088250723408483";
    public static final String PID = "2088721038911613";

    /**
     * 用于支付宝账户登录授权业务的入参 target_id。
     */
    public static final String TARGET_ID = "";

    /**
     * pkcs8 格式的商户私钥。
     * <p>
     * 如下私钥，RSA2_PRIVATE 或者 RSA_PRIVATE 只需要填入一个，如果两个都设置了，本 Demo 将优先
     * 使用 RSA2_PRIVATE。RSA2_PRIVATE 可以保证商户交易在更加安全的环境下进行，建议商户使用
     * RSA2_PRIVATE。
     * <p>
     * 建议使用支付宝提供的公私钥生成工具生成和获取 RSA2_PRIVATE。
     * 工具地址：https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=106097&docType=1
     */
    public static final String RSA2_PRIVATE = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCIp/w3j8uPOffq9Hh2vyj8A9/BqNyiN8ib1PkwTcZgetQ4zxRMfoTOF1aNJb+9kHQ0m9k1zS5IQfBc9" +
            "6WpyRwW4n7ara/5MgA3bFGpe72bcV6zX/8ZoUsDlGXuD8bRlDTSNHu2p0a3XZa+4A9eyjX918ta5JFuG6pegPi+yRzarHVBYfdzK3X0StNNUzJBsUMU2UhBR7E3GGs0pRS7sJWfwvIDXDcsLJBfnGktwlmFEIdyC05" +
            "2EJ1O2aCwTZ5kg30YGkD/00Oalt++gkuJ/l9WCtn+SAluRWYy7CQv177gyxlEvoniTUgUgtuQIX8k6hXIn+VloumaTJL8b10ZyyFBAgMBAAECggEAEK1fjHBSCVKrvNLE+MjveYIHhpzTAEEKjGn7VzfGo/OZfq1W7tbp4" +
            "jTa7TLUKZA9fkYexgAaS9swOEhIwWW3tdtCW/Gibij5+cmQVbyyMQwu4HkwqrISc4diwSDPxLfvkk+xYWMcsDgNs5Gojori9+2j9Z27WdKqggn/UVk92jnPxGqNajkQX5ll9bJxZRA4VWlTpGSGdyEc6IKO3RjqA8DLOJ/fbq" +
            "66WU2veVixrGexFRVdssbS3how+o/k3J88aUht56wQ0t2mDf4vz3YS79xMAt/g5X9t5BUA6ufoLBFJugaobVxmaokkI8eny1Uzzbo54DkiLIgRmPOy2LLaAQKBgQDSjHrNlVkvv+V9oN5ZUpIG9D3mv6KJJX0SKLi/fACOp29xrho" +
            "6uKJVBzslvaUL9vTlDiQ2MYsnqpixfLUBvH7MnxOYce95+uJgWkKkppUsImXyyVK6LDaPVlkk62kS794Cd2sBPI/c8Z9rNzirCShbWPMvJvwFzUrhr8llj7makQKBgQCmJ/5Xvbvp31Nsns7iCkbxsEUNt+zkGEcqZBcdoUFO1rEgIrbQ" +
            "QzPnvUSfloTIwDBT8iHFvxhjPUgylha97Zm/4k4wtop4KmmiKeweCIs+aBkIRAFqfBwsmD2RWs+/2dVo5HzfpQJe8Xt0ivn/m5CXdCeipDaHb7o/IE7ImlaTsQKBgFtSx2koYFjPuTC2d/ryT5hok/jkIhGuiwM3WnrjxDIb+cCrLYFO2E" +
            "pdKpCCI3Z/FVXMvnQrJRp9amGBn9ky8yS50vwKXz7fTRVR0RotjwJnoSSfohxSVQ/y+hODcD3ggME9HtKYfCXvP6B3gULeY/zLJh/LnwC9PL+LSaWdo3mhAoGAPxS18je9TNgVgwpzvstqDb3/KWsni51P/18Ki5w6ACVwD6Q+RakN3rAzimc" +
            "JuHGGp4gonDullZ+hdlsW/Tpkgb34M3RJ878eZYuG8gwKWUIKJuIyq2u9Ao016qZQcyTPacg9RGcQFF2XojJVIV69MVLO7WdssFSRn/+zCWPW9LECgYEAg59GzPtP2daWBX+SYLEm737x/SupRJDCwks5LVtv5cJNepaQ//4eI7aiZmeQBtK5hk" +
            "hr61SDkCrkk6yokncHhI6NpXCPD/2gtxRlpFdxFPuOocfClPD28Tjr+Y9Oh3SitUTqKvb6vzIpMHPzC4/ndm9Z2Bt41hoSx77JtpTypGI=";


//    public static final String RSA2_PRIVATE = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCZvSdsyBQAXnS" +
//            "DryjYGnaXkHStn7h3Wrn/2qwdnd+FsQOn37HAzFotbhuR0YOOkiuHfYbCHMSBK6Y9jpwadzMcYtPnyeCozcNme1E+Km0r7vu5DSz5" +
//            "jhDoehQ4WgspHa7mujaa7GVZdifFPw1c7Ez1wLJX9BC4yoxO/Tz875lRuGoW9Panz14sYNZQ7c9wTRCQDySyBDeVabiUhz2AWqGS+xX9" +
//            "B6ugjrGj7KHRGn6Qg9utSxBkhw70TNpFE2/E/hWs/uWmEOf9q9YQmSW80bBRRlP+texx9OevHuUqW39E7RD9t7pw2FSsSHRGyWIHyPzac9B" +
//            "DpFiPDBeUpiVq0kS1AgMBAAECggEBAIPxmUJ9PN1MM4dI7y75F0rhCaJxb+nPjc6OKCWK9ulQkKilDXNAbyyKUVMGk3fq7zzreJpkAioyAgzWt" +
//            "hboso7sKp3F3vBBGDB+Ka3Gz8di5dtd+Xl8efpru6rZbLau6QrQSkkQFbN/+oYIpTlY/Hv2E5n0t91AyMaKBKu4HsfIv4zSDCeApRNB3Ul3aNmkq4x" +
//            "PJXZtvnLNb9NEKqZWPOC5VFsJu2hB7SaG4+my+m0ciTzl+bXWzcyoG4QOglXkF437SKDVwguZ3q/HSm4O25XpH7EFk6HHzD0u6XdxznvnsK6z6h8VqY8s6" +
//            "j8DcLE9YF1AH4xAUzv0JN8PSAEcQIECgYEAxspFukSn0eCkR1wMASXIr7fF4iPSR2sRP56OvXs0o/Ur6gORpnBMBErNQwP8cSOXUcK6H68gy0qWJhtyKivG5W" +
//            "GRn9eqqgQ9QONzg3q1lKzKpN65/igoyOEUWWuNx/M7yloggU2CJOkN6CCc+hEVjkRz61+GkX0DwNZuNX1/oDECgYEAxfvDB7qxcdyPFk0Tmy7KvPF4fJjnVg0k5I2" +
//            "022bKdK/Lq9474ycmyeSGER+verR8ghTOnAQutg1TqevP8MRcef2649vcW17UR1bdlWrENljKIBTvwd6Ddg0nvrOZ68xoUFKb3vqJ4PuJcdVCbWLJvrKLQWI1uHMwuXn" +
//            "0lIqjL8UCgYAGLcFPEdU5g8b3ZNgGrRr4wziGV+CwUZaeqJn9L7gqJHOx+VxslO737y9EFvqgtZ99bhUE6ReW2gGiu5Wn0+aBuK+jDTwDvs/8lVVAz+6W6Wv/BeE4Eh16aO" +
//            "yN/vbQMTI5juWVv0f9R7Uj8ueOKjvGSUBlH3n6Sa11L/UK+pSd8QKBgGXGiHm+tV1M/pl+QefyY/JBR6j1iWapFyAO4Lww2T6m6FKPycV56Oy8d1byLOktQxwzygpV9BVOQIYH" +
//            "XTvuFYP4tUxRR7QIyaNqujoHSpqNhkp7uMy2sGnNVXMpLKUUzUMNVGeJ77siU4ObF6zXrdJEQmX4MJmDTbbrRJnfswfpAoGBAITmyukSzwmm+MxbQz0ACQii6E3h0OpuIpuCN6psB" +
//            "GucakRRqR5AQMSuh6ABVb5l1fGwPHj+4XAeQOgGmE6P4W5nRgtJ05FtENF9Du0VxILU+zS9AFqEaUIcmMm9f0eQ8G1Y3FnMuDBsjzCam6otCmqJtMEsHypdjCRca3/9ONpa";



    /*预览图片*/
    public static void Image(Context context, String url, ImageView imageView) {
        if (!TextUtils.isEmpty(url)) {
            String substring = url.substring(0, 4);
            if (substring.equals("http")) {
//                Glide.with(context).load(url).into(imageView);
                Glide.with(context).load(url).error(R.mipmap.app_logo).into(imageView);
            } else {
                //HttpUrlManager.huaweiObs  ADDIMAGE
//                Glide.with(context).load(Page.ADDIMAGE + url).into(imageView);
                //circleCrop().圆形头像
                Glide.with(context).load(HttpUrlManager.huaweiObs + url).error(R.mipmap.app_logo).into(imageView);
            }
        }
    }
}
